package demo.spring.batis.accesstocken;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Qian on 2017/6/14.
 */
@RestController
public class Test {
    private String uuserId="123";
    private String UplatId="321";
    @RequestMapping(value = "/aa")
    public String file() {
        TokenInfo tokenInfo = new TokenInfo(uuserId, System.currentTimeMillis() + OpenApiSysConfig.TOKEN_7D_EXPRIE, "",UplatId);
        String tokenStr = JWTUtil.jwtGen(tokenInfo);
        return tokenStr;
    }
    @RequestMapping(value = "/bb")
    public String files() {
        String accessToken1="eyJhbGciOiJIUzUxMiIsInR5cGUiOiJKV1QifQ.eyJzdWIiOiIxMjMiLCJleHBpciI6MTQ5NzQyODY4NjIyNywidXBsYXRJZCI6IjMyMSIsImlzcyI6IiJ9.5nZ7zW7_y5Gow6UL5HfU4ppbuiFez6KjJPNUJV0lyZCNksbjf43EsIzCWFnKKD2pHNSz9IgcSPa4kdqsXEvTmw";
        TokenInfo tokenInfo= JWTUtil.parseJWTInfo(accessToken1);
        String uplat_Id1 =tokenInfo.getUplatId();
        String uuserId1= tokenInfo.getUuserId();
        System.out.println("-------------"+uplat_Id1+"----------------"+uuserId1);
        return "1" ;
    }
}
